<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <!-- 需求：点击按钮,改变div多个样式的属性值 -->
    <button>按钮</button>
    <div id="div" style="width:200px;height:200px;border:1px solid #ddd;"></div>
    <script>
        var btn = document.querySelector('button');
        btn.onclick = function () {
            document.getElementById('div').style.backgroundColor = "red";
        }
        // 面向过程适用于不需要共享的小项目
    </script>    
</body>
</html>